# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=rime-ls
pkgver=0.4.0
pkgrel=0
pkgdesc="Language server for Rime input method engine"
url="https://github.com/wlh320/rime-ls"
arch="all"
license="BSD-3-Clause"
_llvmver=18 # keep in sync with main/rust
makedepends="
	cargo
	cargo-auditable
	clang$_llvmver-libclang
	librime-dev
	"
checkdepends="rime-plum-data"
source="https://github.com/wlh320/rime-ls/archive/v$pkgver/rime-ls-$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dvm755 target/release/rime_ls \
		-t "$pkgdir"/usr/bin/
}

sha512sums="
4cc382ad6f4b8b02bfd155f8b38f20e99d74dfa50838d07206dfaae11d082862b86030e2a2fb692c7bbd4435d3248e867f47e3128819c2979c31928d77b1d01e  rime-ls-0.4.0.tar.gz
"
